﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>考试详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../static/css/font.css">
    <link rel="stylesheet" href="../../../static/css/weadmin.css">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="weadmin-body">
        <fieldset class="layui-elem-field">
            <legend>考试信息</legend>
            <div class="layui-field-box">
                <table class="layui-table">
                    <tr>
                        <td>考试部门：<span id="DepName"></span></td>
                        <td>考试人员：<span id="EmpName"></span></</td>
                        <td>流水号：<span id="EUExamStream"></span></</td>
                    </tr>
                    <tr>
                        <td>试卷满分：<span id="EUFullMarks"></span></</td>
                        <td>考生得分：<span id="EUMark"></span></</td>
                        <td>是否完成：<span id="EUComplete"></span></</td>
                    </tr>
                    <tr>
                        <td>开始时间：<span id="EUStart"></span></</td>
                        <td>结束时间：<span id="EUEnd"></span></</td>
                        <td>考试时长：<span id="EUTime"></span>分</</td>
                    </tr>
                </table>
            </div>
        </fieldset>
        <fieldset class="layui-elem-field">
            <legend>答题信息</legend>
            <div class="layui-field-box" id="questionsList">

            </div>
        </fieldset>
    </div>
    <script src="../../../lib/layui/layui.js" charset="utf-8"></script>
    <script src="../../../static/js/common.js" charset="utf-8"></script>
    <script src="../../../lib/other_extends/template-web.js" charset="utf-8"></script>
    <script id="tpl" type="text/html">
        {{each $data}}
        <div class="caller-main caller-fl">
            <p><strong>第{{$value.EAOrder}}题</strong></p>
            <p>试题内容：<em>{{$value.EQContent}}</em></p>
            <p>考生答案：<em>{{$value.EARAnswer}}</em></p>
            <p>正确答案：<em>{{$value.EAAnswer}}</em></p>
            <p>试题得分：<em>{{$value.EAMark}}</em></p>
        </div>
        {{/each}}
    </script>
    <script>
        layui.use(['jquery', 'layer'], function () {
            var $ = layui.jquery,
                layer = layui.layer;
            $.support.cors = true;
            $.ajaxSetup({
                cache: false,
                headers: {
                    "userid": JSON.parse(window.localStorage.authInfo).UserId,
                    "signtoken": JSON.parse(window.localStorage.authInfo).SignToken,
                },
            })
            $.ajax({
                url: ApiUrl + "ExamSearch/GetExamResultDetail",
                type: 'get',
                dataType: 'json',
                data: { EUID: getUrlParam("EUID") },
                success: function (data) {
                    console.log(data)
                    if (data.StatusCode == 200) {
                        $.each(data.Data[0][0], function (name, value) {
                            if (name == "EUComplete") {
                                $("#" + name).text(value == "1" ? "是" : "否");
                            }
                            else {
                                $("#" + name).text(value);
                            }
                        });
                        $("#questionsList").append(template("tpl", data.Data[1]));
                        //如模板中$data改成data，则需传递json格式，如下
                        //$("#questionsList").append(template("tpl", { data: data.Data[1] }));
                    }
                    else if (data.StatusCode == 403) {
                        top.layer.alert(data.Info + ",请重新登录！", { closeBtn: 0 }, function () {
                            top.location.href = "http://" + top.location.host + "/login.html";
                        })
                    }
                    else {
                        layer.msg(data.Info);
                    }
                }
            });
        });
    </script>
</body>
</html>